#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	int arr[100];
	int i;
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	int count = 0;
	for (i = 0; i < n; i++)
	{
		if (arr[i] == 2)
			count++;
	}
	printf("%d", count);
	return 0;




}